home *** CD-ROM | disk | FTP | other *** search
- #include "userconf.h"
-
- /*
- Find out if a user account is of the same category than another
- one.
-
- If other == NULL, it is assumed to be a normal ordinary user.
- */
- PUBLIC int USER::is_like (USER *other)
- {
- int ret = 0;
- if (!special){
- if (other == NULL){
- ret = !is_admin();
- }else if (!other->special){
- ret = is_admin() == other->is_admin();
- }
- }else if (other != NULL && other->special){
- ret = strcmp(shell.get(),other->getshell())==0;
- }
- return ret;
- }
-
-
- /*
- Set the default information of an account from another.
- */
- PUBLIC void USER::setlike (USER *other)
- {
- if (other != NULL){
- shell.setfrom (other->getshell());
- wrkdir.setfrom (other->wrkdir.get());
- special = other->is_special();
- uid = other->getuid();
- gid = other->getgid();
- }
- }
-
-